package com.qing.search

import org.apache.spark.{Partition, SparkContext, TaskContext}

import scala.collection.mutable.ListBuffer

/**
  * Created by wuliao on 2017/8/21.
  */
private[search] class LuceneRDD(@transient sc: SparkContext,
                                    params: java.util.Map[String, Array[String]])
  extends AbstractLuceneRDD[ListBuffer[Tuple2[Float,String]]](sc, params) {
  override def compute(split: Partition, context: TaskContext): Iterator[ListBuffer[Tuple2[Float,String]]] = {
    new LuceneRDDIterator(context, split.asInstanceOf[LucenePartition].path, params)
  }
}